/* Copyright (c) 2009 SpringShowcase, Inc.
 * All right reserved.
 * http://code.google.com/p/springshowcase/
 * This software is the confidential and proprietary information of BeyondWeb
 * , Inc. You shall not disclose such Confidential Information and
 * shall use it only in accordance with the terms of the license agreement
 * you entered into with BeyondWeb.
 *
 * Revision History
 * Author              Date             Description
 * ------------------   --------------    ------------------
 *  kwondohee           2010. 4. 2.        
*/
package org.springshowcase.mvc;

import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;

/**
 * @author kwondohee
 *
 */
public class UserValidator implements  Validator{
	public boolean supports(Class clazz) {
		return User.class.isAssignableFrom(clazz);
	}

	public void validate(Object object, Errors errors) {
	
		//ValidationUtils 이용 부분
		ValidationUtils.rejectIfEmptyOrWhitespace(errors, "id", "message",
				new Object[] { "email" }, "Enter your email");
	}
}
